package org.coco.mvc.render.impl;

import org.coco.mvc.RequestProcessorChain;
import org.coco.mvc.render.ResultRender;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;

/**
 * 请求资源未找到处理器
 */
public class ResourceNotFoundResultRender implements ResultRender {

    @Override
    public void render(RequestProcessorChain requestProcessorChain) throws Exception {
        HttpServletResponse response = requestProcessorChain.getResponse();
        HttpServletRequest request = requestProcessorChain.getRequest();
        request.getRequestDispatcher("/templates/404.html").forward(request,response);
    }
}
